<?php
/**
 * Created by PhpStorm.
 * User: fangwei
 * Date: 2019-07-03
 * Time: 23:30
 */

namespace App\Http\Controllers\Admin\View;


use App\Http\Controllers\Controller;
use App\Http\Repositories\Services\ICategory;
use App\Http\Repositories\Services\IClient;

class ClientController extends Controller
{
    protected $clientService;
    protected $categoryService;

    public function __construct(
        IClient $clientService,
        ICategory $categoryService
    )
    {
        $this->clientService = $clientService;
        $this->categoryService = $categoryService;
    }
    public function index(){
        return view('admin.client.index');
    }

    public function store(){
        $category = $this->categoryService->getAll();
        return view('admin.client.create',compact('category'));
    }

    public function clinch(){
        return view('admin.client.index');
    }

    public function update($id){
        $dao = $this->clientService->byId($id);
        $category = $this->categoryService->getAll();
        return view('admin.client.edit',compact('dao','category'));
    }
    public function remind($id){
        return view('admin.client.remind',compact('id'));
    }
    public function select(){
        return view('admin.client.select');
    }


}